/**
 * caicongyang.com Inc.
 * Copyright (c) 2004-2017 All Rights Reserved.
 */
package com.caicongyang.design.composite;

/**
 *
 * 方便客户端统一的使用组合结构中的对象，从而忽略组合对象与当个对象的不同
 * @author caicongyang1
 * @version id: CompositeClientTest, v 0.1 17/5/18 下午8:24 caicongyang1 Exp $$
 */
public class CompositeClientTest {
    public static void main(String[] args) {
        Composite root = new Composite("CTO");
        Composite c1 = new Composite("架构师");
        Composite c2 = new Composite("项目经理");
        Composite c3 = new Composite("测试经理");


        Leaf l1 = new Leaf("码农");
        c2.add(l1);

        Leaf l2 = new Leaf("测试");
        c3.add(l2);


        root.add(c1);
        root.add(c2);
        root.add(c3);

        root.dispay(1);


    }
}
